import { http } from "@/utils/request";
import { ILogin, IUserInfo } from "./user.type";
import { IResponse } from "../index.type";

/**登录 */
// export const login = (data: ILogin): Promise<ILoginResponse> => {
//     return service.post('url', data)
// }
export const login = (type: string, data: ILogin) => {
    return http.post<IResponse>(`/sys/~${type}~/user/login`, data)
}
/**
 * @description 用户退出登录
 * @returns {string}
 */

export const logout = () => {
    return http.post<IResponse>(`/sys/user/logout`)
};

/**
 * 用户重置密码
 */
export const resetPassword = (data: IUserInfo) => {
    return http.post<IResponse>(`/sys/user/password/reset`, data)
};
